/*
 * tuple.h
 *
 *  Created on: 19-05-2013
 *      Author: Artur Góralewski
 */

#ifndef TUPLE_H_
#define TUPLE_H_

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>

//maximum number of elements in a tuple
#define MAX_SIZE_OF_TUPLE 50

//type of data
typedef enum {STRING, INTEGER, FLOAT} type_of_data;

//data in element
typedef union
{
	char* _string;
	int _integer;
	float _float;

}data;

//element in tuple
typedef struct element_t
{
	struct element_t *next;
	type_of_data type;
	data data;

}element_of_tuple;

//tuple
typedef struct
{
	element_of_tuple* first;

}tuple;

//function that creates the tuple
//its args are first - is number of elements in the tuple
//the rest of args are elements
tuple* create_tuple(const int amount_args, ...);

//additional function that adds a element to the tuple
void add_elem_to_tuple (tuple *tuplek, const element_of_tuple elem);

//function that prints the tuple
void print_tuple(const tuple *tuplek);

//function that deletes the tuple
void delete_tuple(tuple *tuplek);

#endif /* TUPLE_H_ */
